package cn.javacc.nav.web;

import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cn.javacc.nav.service.CategoryService;
import cn.javacc.util.BaseController;

@Controller
@RequestMapping("category")
public class CategoryController extends BaseController {
	@Inject
	private CategoryService categoryService;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public String listCategorys(@RequestParam(defaultValue = "0") Integer toPage, @RequestParam(required = false) Integer pageSize, HttpServletRequest request) {
		request.setAttribute("pageData", categoryService.query(toPage, pageSize));
		return "cms/admin/nav/cateList";
	}

}
